# 有三个集合，分别表示三门学科的选课学生姓名(一个学生可以同时选多门课)，

# 1.求选课学生总共有多少人

s_history = {'小明', "张三", '李四', "王五", 'Lily', "Bob"}
s_politic = {'小明', "小花", '小红', "二狗"}
s_english = {'小明', 'Lily', "Bob", "Davil", "李四"}
# print(len( s_1 | s_2 | s_3))
# 2.求只选了历史的人的数量和对应的名字
# print(len((s_1-s_2)-s_3),((s_1-s_2)-s_3))
# 3.求只选了一门学科的学生的数量和对应的名字
# print(len((s_1^s_2^s_3)^(s_1&s_2&s_3)),(s_1^s_2^s_3)^(s_1&s_2&s_3))
# 4.求只选了两门学科的学生的数量和对应的名字
only_history_politic = s_history & s_politic- s_english
only_history_english = s_history & s_english - s_politic
only_politic_english = s_english & s_politic - s_history
only_two = only_history_politic | only_history_english | only_politic_english
print(len(only_two), only_two)
# 5.求选了三门学生的学生的数量和对应的名字
# print(len((s_1&s_2)&(s_1&s_3)&(s_2&s_3)),(s_1&s_2)&(s_1&s_3)&(s_2&s_3))